package com.itheima_13;

import java.util.TreeMap;
import java.util.TreeSet;

public class test_13_1 {
    public static void main(String[] args) {
        String temp;
        String str="If you want to change your fate I think you must come to the dark horse to learn java";
        TreeMap<String,Integer> tm=new TreeMap<>();
        String[] split = str.split(" ");
        for (int i = 0; i < split.length; i++) {
            temp=split[i];
            int count=0;
            for (int j = 0; j < split.length; j++) {
                if(temp.equals(split[j])){
                    count++;
                }
            }
            tm.put(temp,count);
        }

        System.out.println(tm);
    }
}
